Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Passing temp-tables as parameters
Chapter 11, "Defining and Using Temp-tables," and Chapter 20, "Creating and Using Dynamic Temp-tables and Browses," describe how you can pass temp-tables from one routine to another using the static
TABLEparameter form, the dynamicTABLE-HANDLEparameter form, or simply by passing theHANDLEof the temp-table. It is extremely important that you be aware of the cost of passing temp-tables by value, that is, by copying the temp-table from one procedure to another, which is the default when you use theTABLEorTABLE-HANDLEparameter form. You can avoid this overhead by passing temp-tables using the simpleHANDLEparameter whenever possible, if your routine call is within the same session. When you pass the handle to a temp-table, as with any object, you are simply passing a pointer to its location elsewhere in the session. Using theHANDLEform is possible only when the procedure call is always within a single session. It also restricts you to using only dynamic language syntax to access the temp-table within the procedure that receives only its handle.Especially when the routine receiving the temp-table is only an intermediary, which simply passes the temp-table on to some other routine, there is never a need to pass the table itself and the
HANDLEparameter form is often the simplest technique for avoiding unneeded copying of the table.Alternately (starting with OpenEdge Release 10.1A), if it's important to be able to use static syntax to access the temp-table, or the call is sometimes local and sometimes remote, you can pass a temp-table by reference and avoid the copying of the table in those instances when the call is local. When you use
BY-REFERENCEand the call is between different sessions, the temp-table is copied. However, when the call is within the same session,BY-REFERENCEpasses just a pointer to a temp-table location rather than making a copy.Observing these guidelines whenever you use temp-tables can greatly improve your application’s performance.
Note: These guidelines apply equally to passing ProDataSets as well as individual temp-tables.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |